package dao.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.TableGenerator;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 代理商表
 * IfwAgentRegInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ifw_agent_reg_info", catalog = "fw")
public class IfwAgentRegInfo extends BasePojo implements java.io.Serializable {

	// Fields

	private Integer agentIndex;
	private String agentName;
	private String agentPhone1;
	private String agentPhone2;
	private String agentEmail;
	private String agentAddr;
	private String agentRegTime;
	private Integer agentPoint;
	private Set<IfwAgentDevInfo> ifwAgentDevInfos = new HashSet<IfwAgentDevInfo>(
			0);
	private Set<IfwAgentConsumeRecord> ifwAgentConsumeRecords = new HashSet<IfwAgentConsumeRecord>(
			0);

	@Override
	public Object getEntityId() {
		// TODO Auto-generated method stub
		return agentIndex;
	}

	// Property accessors
	@Id
	@TableGenerator(name = "AGENTINDEX_GEN", table = "sequence", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "SEQ_AGENTINDEX", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "AGENTINDEX_GEN")
	@Column(name = "agent_index", unique = true, nullable = false)
	public Integer getAgentIndex() {
		return this.agentIndex;
	}

	public void setAgentIndex(Integer agentIndex) {
		this.agentIndex = agentIndex;
	}

	@Column(name = "agent_name", nullable = false, length = 32)
	public String getAgentName() {
		return this.agentName;
	}

	public void setAgentName(String agentName) {
		this.agentName = agentName;
	}

	@Column(name = "agent_phone1", length = 32)
	public String getAgentPhone1() {
		return this.agentPhone1;
	}

	public void setAgentPhone1(String agentPhone1) {
		this.agentPhone1 = agentPhone1;
	}

	@Column(name = "agent_phone2", length = 32)
	public String getAgentPhone2() {
		return this.agentPhone2;
	}

	public void setAgentPhone2(String agentPhone2) {
		this.agentPhone2 = agentPhone2;
	}

	@Column(name = "agent_email", nullable = false, length = 64)
	public String getAgentEmail() {
		return this.agentEmail;
	}

	public void setAgentEmail(String agentEmail) {
		this.agentEmail = agentEmail;
	}

	@Column(name = "agent_addr")
	public String getAgentAddr() {
		return this.agentAddr;
	}

	public void setAgentAddr(String agentAddr) {
		this.agentAddr = agentAddr;
	}

	@Column(name = "agent_reg_time", nullable = false, length = 14)
	public String getAgentRegTime() {
		return this.agentRegTime;
	}

	public void setAgentRegTime(String agentRegTime) {
		this.agentRegTime = agentRegTime;
	}

	@Column(name = "agent_point", nullable = false)
	public Integer getAgentPoint() {
		return this.agentPoint;
	}

	public void setAgentPoint(Integer agentPoint) {
		this.agentPoint = agentPoint;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ifwAgentRegInfo")
	public Set<IfwAgentDevInfo> getIfwAgentDevInfos() {
		return this.ifwAgentDevInfos;
	}

	public void setIfwAgentDevInfos(Set<IfwAgentDevInfo> ifwAgentDevInfos) {
		this.ifwAgentDevInfos = ifwAgentDevInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ifwAgentRegInfo")
	public Set<IfwAgentConsumeRecord> getIfwAgentConsumeRecords() {
		return this.ifwAgentConsumeRecords;
	}

	public void setIfwAgentConsumeRecords(
			Set<IfwAgentConsumeRecord> ifwAgentConsumeRecords) {
		this.ifwAgentConsumeRecords = ifwAgentConsumeRecords;
	}

}